<template>
	<view class="search_global">
		<!-- 搜索页面 -->
		<uni-forms @click="formClick" :modelValue="formData" :label-width="80" label-align="right">
			<uni-forms-item label="流程名" name="name">
				<uni-easyinput type="text" v-model="formData.name" placeholder="请输入" />
			</uni-forms-item>
			<uni-forms-item label="所属流程" name="processDefinitionId">
				<uni-easyinput type="text" v-model="formData.processDefinitionId" placeholder="请输入" />
			</uni-forms-item>

			<uni-forms-item class="select_box" label="流程分类" name="category">
				<uni-data-select v-model="formData.category" :localdata="$mapData('bpm_model_category')">
				</uni-data-select>
			</uni-forms-item>



			<uni-forms-item @click="formClick(123)" label="提交时间" name="createTime">
				<!-- <uni-easyinput  type="text" v-model="formData.createTime" placeholder="请输入" />
				 -->
				<uni-datetime-picker type="daterange" v-model="formData.createTime" />
			</uni-forms-item>
			<uni-forms-item label="状态" name="status">
				<uni-data-select v-model="formData.status" :localdata="$mapData('bpm_process_instance_status')">
				</uni-data-select>

			</uni-forms-item>
			<uni-forms-item label="结果" name="result">
				<uni-data-select v-model="formData.result" :localdata="$mapData('bpm_process_instance_result')">
				</uni-data-select>
			</uni-forms-item>
			<button @click="searchFn">搜索</button>
			<!-- <uni-forms-item required name="hobby" label="兴趣爱好">
				<uni-data-checkbox multiple v-model="formData.hobby" :localdata="hobby"/>
			</uni-forms-item> -->
		</uni-forms>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formData: {},
				range: [{
						value: 0,
						text: "篮球"
					},
					{
						value: 1,
						text: "足球"
					},
					{
						value: 2,
						text: "游泳"
					},
				],
			}
		},
		methods: {
			formClick() {
				console.log('form背电极')
			},
			searchFn() {
				console.log('搜索数据', this.formData)
				// 把搜索值给到页面
				const pages = getCurrentPages();
				const previousPage = pages[pages.length - 2];
				previousPage.$vm.setSearchResult(this.formData);
				uni.navigateBack();

			}
		}
	}
</script>

<style lang="scss">






</style>